//
//  OosCheckin.m
//  Oos4ios
//
//  Created by Pablo Gonzalez on 3/29/11.
//

#import <oos4ios/Model/OosCheckin.h>


@implementation OosCheckin

@dynamic service;
@dynamic user;
@dynamic count;

static NSString *matchPatern = @"service.slug = %@ AND user.slug = %@";

+ (OosCheckin *) checkinFromUser: (OosUser *) user 
					 andService: (OosService *) service
{
    
    OosCheckin *result = [super objectWithPredicate:matchPatern, 
                          service.slug, user.slug];
    
    if (!result) {
        result = [super create];
        result.user = user;
        result.service = service;
    }
    
    return result;
}

@end
